Modern electronic computing devices are becoming increasingly pervasive. These devices commonly include graphic displays that offer the ability to display images of increasing detail and complexity. Often, the images displayed on the graphic displays are multicolored and multilayered and consist of a background image and one or more overlay images. These combined images have applications in a variety of fields including medical imaging applications, such as in Picture Archive and Communication Systems (PACS), and computer graphics generally.
Each pixel of an electronic image, such as that displayed on a computer monitor, may be represented as a series of values. For example, it is common for each pixel of a color electronic image to be represented by the vector (R, G, B, A), where R represents red, G represents green, B represents blue, and A represents the alpha or the opacity. R, G, and B may be referred to as color channels. Similarly, A may be referred to as an alpha channel. Each of the colors channels can take on a value between a predetermined minimum value and a predetermined maximum value. According to one standard, the minimum value is 0 and the maximum value is 255. In addition, according to that standard, each channel can take on an integer value between the minimum and maximum value inclusive, allowing for a total of 256 values. A color channel with a value of 0 generally denotes the absence of that color in the given pixel and a color channel with a value of 255 represents the pixel being fully saturated with that color. The alpha channel (represented as A) may also take on a value between 0 and 255, where 0 represents the pixel being fully transparent and 255 represents the pixel being completely opaque. For example, a pixel represented as (0, 0, 255, 255) is a pixel that is fully blue and fully opaque. However, if the alpha value is set to 100 then the pixel is represented as (0, 0, 255, 100). Such a pixel is fully blue but is translucent.
However, as used from here on in, the terms color channel and alpha channel will be associated with normalized values. Thus, for the color channels 0 will represent the absence of a particular color, while 1 will represent a fully saturated color. Similarly, for the alpha channel, 0 will represent full transparency and 1 will represent full opacity.
An image having an alpha channel may be overlaid on top of another image. Regardless of whether the underlying image has an alpha channel or not, combining the two images may require the blending of colours. Consider the case where the overlay image has an alpha channel and the underlying image does not. Thus, each pixel of the overlay image may be represented as (R, G, B, A) and each pixel of the underlying image may be represented as (R, G, B). When one image with an alpha channel is overlaid on top of another image, which does not have an alpha channel, the color that a particular pixel takes on is dependent on the colors of the pixels of the overlay and background images at that position, as well as the opacity of the overlay image at that position. Thus, for a particular pixel of a combined image, the color values may be calculated as:Cout=Coverlay*Aoverlay+Cimage*(1−Aoverlay)  (1)wherein Cout represents the normalized color channels of the resulting image, Coverlay represents the color channels of the overlay image, Cimage represents the color channels of the background image, Aoverlay represents the alpha value of the overlay image. Each of the Cout, Coverlay, and Cimage are in fact vectors containing each of the color channels of the particular pixel. For example, Cout=(Rout, Gout, Bout). The above-described process by which the color channels are combined may be referred to as alpha blending.
It is often necessary to scale and/or rotate images that contain a background image and at least one overlay image. Some prior art methods scale the overlay image and the background image separately before combining the two through the use of alpha blending. This leads to a number of undesirable qualities, such as distortion or artifacts. In particular, in the final image, overlay lines appear thinner than they should. In addition, the edges of overlays may be tinged with a dark shade, which in turn, results in a choppy shadow around the overlay features.
FIGS. 1A to 1I illustrate why the problem occurs in the prior art. As can be seen from Equation (1), the alpha channel effectively serves as a multiplier for the color channels when alpha blending is done. FIGS. 1A to 1C illustrate the prior art methods when no scaling is performed. FIG. 1A is a diagram illustrating a plot 2A of color values at various pixels for a single color channel. Axis 4A represents the value of the color channel while axis 6A represents pixel positions. Thus, the only values of concern in plot 2A are those that appear above the gradations along axis 6A. FIG. 1B illustrates a plot 2B of alpha channel values for the same pixels as in FIG. 1A. FIG. 1C illustrates the color channel values that result from the first product (Coverlay*Aoverlay) in Equation (1) at the same pixel positions as in FIGS. 1A and 1B. As can be seen from a comparison of plots 2C and 2A, there is no distortion.
FIGS. 1D to 1F illustrate plots similar to FIGS. 1A to 1C except that they are for the case where the image has been scaled up prior to the application of Equation (1). As can be seen from a comparison of plots 2F and 2D, distortion occurs at the point designated as 8F relative to the point marked as 8D. This occurs because the alpha channel value at 8E serves as a multiplier for the color channel at point 8D.
FIGS. 1G to 1H illustrate similar plots to FIGS. 1A to 1C except that they are for the case where the image has been scaled down prior to the application of Equation (1). As can be seen, distortion occurs in plot 2I relative to plot 2G at the peak. Again, the distortion occurs as a result of the alpha channel value at the peak of plot 2H serving as a multiplier for the color channel at the pixel corresponding to the peak of plot 2G.
One method to overcome these problems is to combine the overlay image with the background image and then scale the combined image. However, this leads to additional problems. In particular, it is often the case that the background image changes or is modified relatively frequently, while the overlay images remain relatively constant. In such a case, this method would be overly computationally intensive and inefficient. Thus, there is a need for a system and method that overcomes the above-mentioned problems and can scale images having a background image and at least one overlay image.